<?php
if(!defined('IN_THANKPHP_SYSTEM')) exit('Access Denied!');

class debug {
	private $infos = array();
	public $types = array('notice', 'error', 'parse');
	public $save = 'nosave';
	#array('database', 'file', 'nosave')
	public $htmlview = false;
	
	public function init(){
		return new self();
	}
	
	
	
	public function add($obj, $type){
		$this->infos[] = array(
			'message'	=>	$this->getMsg($obj),
			'type'		=>	$this->checkType($type)
		);
		return $this;
	}
	
	private function checkType($type){
		if(!in_array($type, $types)){
			$this->add(__class__.'.'.__method__.'.notfit', 'notice');
			return 'unknown';
		}
		return $type;
	}
	
	private function getMsg($obj){
		return $obj;
	}
	
}